home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / admin / xinetd.2 / xinetd / xinetd.2.1.7-linux.4 / libs / src / pq / Makefile < prev    next >
Encoding:
Makefile  |  1993-07-25  |  3.4 KB  |  139 lines

  1. # (c) Copyright 1993 by Panagiotis Tsirigotis
  2. # All rights reserved.  The file named COPYRIGHT specifies the terms 
  3. # and conditions for redistribution.
  4.  
  5. #
  6. # $Id: Makefile,v 2.2 1993/05/06 07:50:44 panos Exp $
  7. #
  8. # Based on Library makefile template: *Revision: 1.15 *
  9. #
  10.  
  11. # Available entries:
  12. #         lib             --> creates the library
  13. #        install        --> installs the library (archive, man page(s), header(s))
  14. #        uninstall    --> uninstall the library
  15. #        clean            --> removes all .o and .a files
  16. #        spotless        --> clean + uninstall
  17. #         lint            --> lints a file (usage: make lint MODULE=foo.c)
  18. #        tags            --> creates a tags file (from the SOURCES and HEADERS)
  19. #        checkout     --> checkout all files
  20. #        dist            --> distribution support
  21. #
  22.  
  23. NAME                = pq
  24. VERSION            = 1.0.2
  25.  
  26. HEADERS            = hpq.h hpqimpl.h pq.h
  27. SOURCES            = hpq.c pq.c
  28. OBJECTS            = hpq.o pq.o
  29.  
  30. MANFILES            = pq.3
  31. INCLUDEFILES    = hpq.h pq.h
  32.  
  33. # The following variables are used by the 'install' entry and
  34. # should be customized:
  35. #     LIBDIR:     where the library will be placed
  36. #     INCUDEDIR:  where the include files will be placed
  37. #     MANDIR:     where the man pages will be placed
  38. #
  39. LIBDIR            = $(HOME)/.links/libraries/$(ARCH)
  40. MANDIR            = $(HOME)/.links/manpages/man3
  41. INCLUDEDIR        = $(HOME)/.links/includes
  42.  
  43. DEFS                =                # used for command line defined flags
  44. DEBUG                = -g            # -g or -O
  45. VERSION_DEF        = -DVERSION=\"HPQ\ Version\ $(VERSION)\"
  46.  
  47. CPP_DEFS            = $(VERSION_DEF) $(DEFS)
  48.  
  49. #
  50. # The following variables shouldn't need to be changed
  51. #
  52. LINT_FLAGS        = -hbux
  53. CPP_FLAGS        = $(CPP_DEFS)
  54. CC_FLAGS            = $(DEBUG)
  55. CFLAGS            = $(CPP_FLAGS) $(CC_FLAGS)
  56.  
  57. INSTALL            = install -c
  58. FMODE                = -m 640            # used by install
  59. RANLIB            = ranlib
  60.  
  61. PAGER                = less
  62.  
  63.  
  64. LIBNAME            = lib$(NAME).a
  65.  
  66. lib: $(LIBNAME)
  67.  
  68. libopt: clean
  69.     make DEBUG=-O "DEFS=$(DEFS)" lib
  70.     $(INSTALL) $(FMODE) $(LIBNAME) $(LIBDIR)/optimized
  71.  
  72. $(LIBNAME): $(OBJECTS)
  73.     ar r $@ $?
  74.     $(RANLIB) $@
  75.  
  76. lint:
  77.     lint $(CPP_FLAGS) $(LINT_FLAGS) $(MODULE) 2>&1 | $(PAGER)
  78.  
  79. install: $(LIBNAME)
  80.     @if test "$(LIBDIR)" -a "$(INCLUDEDIR)" -a "$(MANDIR)" ;\
  81.     then \
  82.         $(INSTALL) $(FMODE) $(LIBNAME) $(LIBDIR) ;\
  83.         echo "Installed $(LIBNAME) to $(LIBDIR)" ;\
  84.         for i in $(INCLUDEFILES); do $(INSTALL) $(FMODE) $$i $(INCLUDEDIR) ; done ;\
  85.         echo Installed $(INCLUDEFILES) to $(INCLUDEDIR) ;\
  86.         for i in $(MANFILES) ; do $(INSTALL) $(FMODE) $$i $(MANDIR) ; done ;\
  87.         echo Installed $(MANFILES) to $(MANDIR) ;\
  88.     else \
  89.         echo "You forgot to set one of the following variables: LIBDIR,INCLUDEDIR,MANDIR" ;\
  90.     fi
  91.  
  92. uninstall:
  93.     a=`pwd` ; cd $(INCLUDEDIR) ;\
  94.     if test $$a != `pwd` ; then rm -f $(INCLUDEFILES) ; fi
  95.     a=`pwd` ; cd $(LIBDIR) ;\
  96.     if test $$a != `pwd` ; then rm -f $(LIBNAME) ; fi
  97.     a=`pwd` ; cd $(MANDIR) ;\
  98.     if test $$a != `pwd` ; then rm -f $(MANFILES) ; fi
  99.  
  100. clean:
  101.     rm -f $(OBJECTS) $(LIBNAME) core
  102.  
  103. spotless: clean uninstall
  104.  
  105. tags: $(SOURCES) $(HEADERS)
  106.     ctags -w $(SOURCES) $(HEADERS)
  107.  
  108. checkout:
  109.     co $(SOURCES) $(HEADERS) $(MANFILES)
  110.  
  111. #
  112. # Distribution section
  113. # This section contains the 2 targets for distribution support: dist, dirs
  114. # "dist" checks out all files to be distributed
  115. # "dirs" prints a list of directories to be included in the distribution.
  116. # These directories should have a Makefile with a "dist" target
  117. #
  118. DISTRIBUTION_FILES    = $(HEADERS) $(SOURCES) $(MANFILES) COPYRIGHT
  119. DIRS                        =
  120.  
  121. dist:
  122.     -co -q $(DISTRIBUTION_FILES)
  123.  
  124. dirs:
  125.     @echo $(DIRS)
  126.  
  127. #
  128. # PUT HERE THE RULES TO MAKE THE OBJECT FILES
  129. #
  130. hpq.o: hpq.h hpqimpl.h pq.h
  131.  
  132. #
  133. # Simple test program
  134. #
  135. pqtest: pqtest.c $(LIBNAME)
  136.     cc $(DEBUG) -o $@ pqtest.c $(LIBNAME)
  137.  
  138.